<?php
error_reporting(E_ALL);
ini_set('display_errors', '1');
header('Content-type: application/json');
session_start();
require_once 'Mysql.php';

$mysql = new Mysql();
if(isset($_POST['competition_id'])){
	echo json_encode($mysql->getState($_POST['competition_id'],$_SESSION['user_id']));
}
else {
	echo json_encode($mysql->getState(1,$_SESSION['user_id']));
}